const totalCount = 5
const List = [
  {
    logId: '@id',
    optType: '价格策略保存成功',
    optUserName: '曲丽丽',
    statusLabel: '成功',
    status: '1',
    updated: '@datetime',
    description: '-'
  },
  {
    logId: '@id',
    optType: '系统登录失败',
    optUserName: '付小小',
    statusLabel: '驳回',
    status: '2',
    updated: '@datetime',
    description: '不通过原因'
  },
  {
    logId: '@id',
    optType: '数据异常',
    optUserName: '周毛毛',
    statusLabel: '成功',
    status: '1',
    updated: '@datetime',
    description: '-'
  },
  {
    logId: '@id',
    optType: '查询失败',
    optUserName: '林冬冬',
    statusLabel: '成功',
    status: '1',
    updated: '@datetime',
    description: '数据库错误'
  },
  {
    logId: '@id',
    optType: '人员增加成功',
    optUserName: '汗丫丫',
    statusLabel: '成功',
    status: '1',
    updated: '@datetime',
    description: '-'
  }
]
module.exports = [
  {
    url: '/logManagement/getList',
    type: 'post',
    response(config) {
      const { title = '', pageNo = 1, pageSize = 20 } = config.body
      let mockList = List.filter((item) => {
        if (title && item.title.indexOf(title) < 0) return false
        return true
      })
      const pageList = mockList.filter(
        (item, index) =>
          index < pageSize * pageNo && index >= pageSize * (pageNo - 1)
      )
      return {
        code: 200,
        msg: 'success',
        totalCount,
        data: pageList,
      }
    },
  }
]
